import java.util.Scanner;

public class Main10 {
    public static void main(String[] args) {
        //10、输入字符串长度len1,字符串s1，字符串长度为len2,字符串s2。
        // 从后向前比较，以最短字符串为标准，输出不同的元素的个数。
        //例如：
        //输入：s1="1,3,5”  len1=3
        // s2="2,4,1,7,5" len2=5
        //输出：1
        Scanner scanner = new Scanner(System.in);
        int len1 = scanner.nextInt();
        scanner.nextLine();
        String s1 = scanner.nextLine();

        int len2 = scanner.nextInt();
        scanner.nextLine();
        String s2 = scanner.nextLine();

        String[] arr1 = s1.split(",");
        String[] arr2 = s2.split(",");

        int min = Math.min(len1,len2);
        int res=0;

        for (int i = 1; i <= min; i++) {
            if(!arr1[len1-i].equals(arr2[len2-i])){
                res++;
            }
        }

        System.out.println(res);
    }
}
